NAME=server
all=$(NAME)
CPP=g++
CC=gcc


LIB=-lncurses -lcdk -lpthread
CFLAGS=-Wall -pedantic -Werror -g $(DEBUG)
CPPFLAGS=
SRC=$(wildcard *.cpp *.c)
OBJ=$(SRC:.cpp=.o)
all:	$(all)
$(NAME): $(OBJ)
	$(CPP) $(CFLAGS) $^ -o $(NAME) $(LIB)

%.o: 	%.cpp
	$(CPP) $(CFLAGS) -c $< $(LIB)
%.o: 	%.c
	$(CC) $(CFLAGS) -c $< $(LIB)
clean:
	rm *.o $(NAME) -rf

debug:
	$(MAKE) DEBUG='-DDEBUG'
